import React,{Component} from "react";
import './style.css'

export default class ChildClick extends Component{
    signatureInp = React.createRef()
    state = {
        num:0
    }

    f1 = () =>{
        console.log(this.signatureInp.current.value)
    }

    render(){
        return(
            <div className="child">
                <h3>ClickCounter子组件</h3>
                <button onClick={()=>{this.setState({num:this.state.num+1})}}>当前点击次数{this.state.num}</button>
                <input ref={this.signatureInp} placeholder='请输入登录名称'></input>
                <button onClick={this.f1}>提交个人信息</button>
            </div>
        )
    }
}